package com.dailyblue.java.spring.ioc.demo6;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {
    public static void main(String[] args) {
        // 启动IoC容器，指定扫描内容
        ApplicationContext beans
                = new AnnotationConfigApplicationContext("com.dailyblue.java.spring.ioc.demo6");
        DemoA da1 = beans.getBean(DemoA.class);
        DemoA da2 = beans.getBean(DemoA.class);
        System.out.println(da1);
        System.out.println(da2);
        System.out.println(da1==da2);
        System.out.println("---------------------------");
        DemoB db1 = beans.getBean(DemoB.class);
        System.out.println(db1);
    }
}
